#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define MAX 10

int main() {
    int a[MAX], i, j, tmp, size = MAX;

    srand(time(NULL));

    printf("Array: ");
    for (i = 0; i < size; i ++) {
        a[i] = rand() % 20;
        printf("%d ", a[i]);
    }
    printf("\nSorted: ");
    for (i = 0; i < size - 1; i ++) {
        for (j = 0; j < size - i - 1; j++) {
            if (a[j] > a[j + 1]) {
                tmp = a[j];
                a[j] = a[j + 1];
                a[j + 1] = tmp;
            }
        }
    }

    for (i = 0; i < size; i++){
        printf("%d ", a[i]);
    }
    printf("\n");


    return 0;
}
